/** 
 * File-Name:ESTQueryGenerator.java
 *
 * Created on 2011-10-2 下午03:08:15
 * 
 * @author: Neo (neolimeng@gmail.com)
 * Software Engineering Institute, Peking University, China
 * 
 * Copyright (c) 2009, Peking University
 * 
 *
 */
package com.debugassistant.service.est;

import java.util.ArrayList;
import java.util.List;

import org.neowebcrawler.entity.WebContent;

import com.debugassistant.entity.EST;

/**
 * Description: Generate appropriate queries using the EST.
 * 
 * @author: Neo (neolimeng@gmail.com) Software Engineering Institute, Peking
 *          University, China
 * @version 1.0 2011-10-2 下午03:08:15
 */
public class ESTQueryGenerator {
	
	/**
	 * 
	 * Description: Generate Google queries using EST.
	 * 
	 * @param est
	 * @return List<String>
	 */
	public static List<String> generateGoogleQueries(EST est) {
		try {
			List<String> queries = new ArrayList<String>();

			String shortName = est.getShortName();
			if(shortName != null)
			{
				for(int i = 0; i < 500; i += 10 )
				{
				
					//queries.add("http://www.google.com/search?q=java+exception+" + shortName.replace("+", "%2B").replace(" ", "+") + "&hl=en&start=" + i);
					queries.add("http://www.google.com/search?q=%22" + shortName.replace("+", "%2B").replace(" ", "+") + "%22&hl=en&start=" + i);
				}
			}
			return queries;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	/**
	 * Description:
	 * 
	 * @param args
	 *            void
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
